



//
//  NQiyebanshiCommonViewController.m
//  nncloud
//
//  Created by macfai on 2018/11/21.
//  Copyright © 2018 macfai. All rights reserved.
//

#import "NQiyebanshiCommonViewController.h"
#import "NQiyeServiceCommonCell.h"
#import "NQiyeBanshiDetailVC.h"
#import "NQiyebanshiNewCell.h"
#define cellIdentifier  @"qiyeServe"

@interface NQiyebanshiCommonViewController ()<UITableViewDelegate,UITableViewDataSource>

@property(nonatomic,strong)UITableView *tableView;

@property (nonatomic,strong)NSMutableArray *dataArray;

@property (nonatomic,strong)NSArray *nameArray;

@property (nonatomic,strong)NSArray *picArray;

@end

#define cellIdentifier  @"qiyeServe"

@implementation NQiyebanshiCommonViewController

-(UITableView *)tableView{
    
    if (!_tableView) {
        
//        WeakStament(ws);
        
        _tableView = [[UITableView alloc] initWithFrame:CGRectMake(0 , 0, ScreenWidth , ScreenHeight - 64) style:UITableViewStylePlain];
        _tableView.delegate = self;
        _tableView.dataSource = self;
        _tableView.separatorStyle = 0;
        _tableView.rowHeight = 101.f;
        //        _tableView.separatorColor = [UIColor clearColor];
        _tableView.backgroundColor = kBackgroundColor;
        [_tableView registerNib:[UINib nibWithNibName:@"NQiyeServiceCommonCell" bundle:nil] forCellReuseIdentifier:cellIdentifier];
        _tableView.showsVerticalScrollIndicator = NO;
        _tableView.tableFooterView = [UIView new];
        
    }
    return _tableView;
}


- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = kWhiteColor;
    self.dataArray = [NSMutableArray array];
    if (_btitle) {
         [self.navigationItem setItemWithTitle:_btitle textColor:kNavigationTitleColor fontSize:18 itemType:center];
    }
    
    [self loadData];
    [self.view addSubview:self.tableView];
    // Do any additional setup after loading the view.
}


#pragma mark - delegate
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    
    NQiyeBanshiDetailVC *qi = [NQiyeBanshiDetailVC new];
    
    if ([_btitle isEqualToString:@"投融资服务"]) {
        
        if (indexPath.row==0) {
            
             qi.url = @"http://cdyoue.com.cn:18180/h5/html/qybs/trzfw/zbd.html";
            
        }else if (indexPath.row==1){
            
            qi.url = @"http://cdyoue.com.cn:18180/h5/html/qybs/trzfw/zrd.html";
            
        }else{
           
            qi.url = @"http://cdyoue.com.cn:18180/h5/html/qybs/trzfw/ptd.html";
        }
        
    }else if ([_btitle isEqualToString:@"信息化服务"]){
        
        if (indexPath.row==0) {
            
            qi.url = @"http://cdyoue.com.cn:18180/h5/html/qybs/xxhfw/lhrh.html";
            
        }else if (indexPath.row==1){
            
            qi.url = @"http://cdyoue.com.cn:18180/h5/html/qybs/xxhfw/wzjs.html";
            
        }else if(indexPath.row==2){
            
            qi.url = @"http://cdyoue.com.cn:18180/h5/html/qybs/xxhfw/xtkf.html";
        }else if(indexPath.row==3){
            qi.url = @"http://cdyoue.com.cn:18180/h5/html/qybs/xxhfw/xctg.html";
        }else{
            qi.url = @"http://cdyoue.com.cn:18180/h5/html/qybs/xxhfw/xxhpx.html";
        }
        
    }else if ([_btitle isEqualToString:@"教育培训服务"]){
        
        if (indexPath.row==0) {
            
            qi.url = @"http://cdyoue.com.cn:18180/h5/html/qybs/jypxfw/gkkpx.html";
        }else if (indexPath.row==1){
           qi.url = @"http://cdyoue.com.cn:18180/h5/html/qybs/jypxfw/qynx.html";
        }else if(indexPath.row==2){
            qi.url = @"http://cdyoue.com.cn:18180/h5/html/qybs/jypxfw/hsjy.html";
        }else if(indexPath.row==4){
            qi.url = @"http://cdyoue.com.cn:18180/h5/html/qybs/jypxfw/zzyjs.html";
        }else{
            qi.url = @"http://cdyoue.com.cn:18180/h5/html/qybs/jypxfw/wljy.html";
        }
    }else if ([_btitle isEqualToString:@"知识产权服务"]){
        
        if (indexPath.row==0) {
            
             qi.url = @"http://cdyoue.com.cn:18180/h5/html/qybs/zscqfw/zlzc.html";
            
        }else if (indexPath.row==1){
            
            qi.url = @"http://cdyoue.com.cn:18180/h5/html/qybs/zscqfw/sbzc.html";
            
        }else if(indexPath.row==2){
            
            qi.url = @"http://cdyoue.com.cn:18180/h5/html/qybs/zscqfw/bqdj.html";
            
        }else if(indexPath.row==3){
            
             qi.url = @"http://cdyoue.com.cn:18180/h5/html/qybs/zscqfw/zscqsq.html";
            
        }
        
    }else if ([_btitle isEqualToString:@"商贸流通服务"]){
        
        if (indexPath.row==0) {
            
            qi.url = @"http://cdyoue.com.cn:18180/h5/html/qybs/smltfw/xxzx.html";
            
        }else if (indexPath.row==1){
            
             qi.url = @"http://cdyoue.com.cn:18180/h5/html/qybs/smltfw/jscx.html";
            
        }else if(indexPath.row==2){
             qi.url = @"http://cdyoue.com.cn:18180/h5/html/qybs/smltfw/cyfh.html";
        }else if(indexPath.row==3){
             qi.url = @"http://cdyoue.com.cn:18180/h5/html/qybs/smltfw/glzd.html";
        }else if (indexPath.row==4){
             qi.url = @"http://cdyoue.com.cn:18180/h5/html/qybs/smltfw/sckt.html";
        }
        else{
            qi.url = @"http://cdyoue.com.cn:18180/h5/html/qybs/smltfw/flwq.html";
        }
        
    }else if ([_btitle isEqualToString:@"信用评级服务"]){
        
        if (indexPath.row==0) {
            
            qi.url = @"http://cdyoue.com.cn:18180/h5/html/qybs/xypjfw/xypj.html";
            
        }
        
    }else if ([_btitle isEqualToString:@"人力资源服务"]){
        
        if (indexPath.row==0) {
            
            qi.url = @"http://cdyoue.com.cn:18180/h5/html/qybs/rlzyfw/lwpq.html";
            
        }
        
    }
    
     [self.navigationController pushViewController:qi animated:YES];
    
}

///
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    //    return self.dataArray.count;
    return self.nameArray.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    
    NQiyeServiceCommonCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier forIndexPath:indexPath];
    cell.nameLabel.text = self.nameArray[indexPath.row];
    cell.img.image = WDImgName(self.nameArray[indexPath.row]);
    return cell;
    
}

- (void)loadData {
    
    if ([_btitle isEqualToString:@"投融资服务"]) {
        
    self.nameArray = @[@"助保贷",@"助融贷",@"配套贷",];
        
    self.picArray = @[@"",@"",@"",]; // 图片名称就是名称
        
        
    }else if ([_btitle isEqualToString:@"信息化服务"]){
        
        self.nameArray = @[@"两化融合",@"网站建设",@"系统开发",@"宣传推广",@"信息化培训",];
        
    }else if ([_btitle isEqualToString:@"教育培训服务"]){
        
        self.nameArray = @[@"公开课培训",@"企业内训",@"函授教育",@"网络教育",@"在职研究生",];
        
    }else if ([_btitle isEqualToString:@"知识产权服务"]){
        
        self.nameArray = @[@"专利申请",@"商标注册",@"版权登记",@"产权在线申请",];
        
    }else if ([_btitle isEqualToString:@"商贸流通服务"]){
        
        self.nameArray = @[@"信息咨询",@"技术创新",@"创业孵化",@"管理诊断",@"市场开拓",@"法律维权",];
        
    }else if ([_btitle isEqualToString:@"信用评级服务"]){
        
        self.nameArray = @[@"信用评级",];
        
    }else if ([_btitle isEqualToString:@"人力资源服务"]){
        
        self.nameArray = @[@"劳务派遣",];
        
    }
    
    
    
}


@end
